package band.wukong.practice.netty.sample.tcpsuite;

import band.wukong.practice.netty.NettyConst;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;

/**
 * Desc:
 * author: wukonggg@139.com
 */
public class TcpServerChannelInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new DelimiterBasedFrameDecoder(1024, NettyConst.DELIMITER_B));
        ch.pipeline().addLast(new TcpServerChannelHandler());
    }
}
